home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / trinitybbs20.lha / OLP / TrinityWall < prev    next >
Text File  |  1995-09-26  |  5KB  |  191 lines

  1. /* Trinity BBS Grafiti-Wall Writer/Reader */
  2. /* (c) 1992 By Rodney Martin      */
  3. /* Version 1.0 Generic */
  4. /* Expect A Suped Up Version Soon */
  5.  
  6. options results
  7.  
  8. path = 'olp:TheWall'
  9. sysop = 99
  10. if ~exists(path) then address command 'makedir 'path
  11. getuser 1
  12. user = result
  13. getuser 15
  14. level = result
  15. sendstring 'n1c2Would You Like To View Our Grafiti-Wall (Y/n)? c1'
  16. getchar
  17. ans = result
  18. if ans = '###PANIC' then exit
  19. if upper(ans) = 'N' then do;transmit 'Nope!';exit;end
  20. transmit 'Yes!'
  21. transmit 'n2                  c1r1Trinity BBS Grafiti Wall Reader/Writer V1.5'
  22. transmit 'r0                           c6r1(c)1992 By Rodney Martinr0'
  23. transmit 'n2'
  24.  
  25. dte = date(USA)
  26. total = 0;w = 0;m = 0 
  27. te=0
  28. if exists(path'/count') then do;call open(file,path'/count','R');te = readln(file);call close(file);end
  29. sendstring 'c2Searching For New Writings...'
  30. new = 0
  31. if ~exists(path'/users') then do;call open(file,path'/users','W');call close(file);end
  32. call open(file,path'/users','R')
  33. p = 0;a = 0
  34. do until eof(file)
  35. p = seek(file,a*35,'B')
  36. name = readch(file,30)
  37. w = readch(file,5)
  38. if trim(name) = user then leave
  39. a = a +1
  40. end
  41. call close(file)
  42. if trim(name) ~= user then do;call open(file,path'/users','A');seek(file,p,'B');writech(file,substr(user,1,30,' '));w = 0;writech(file,substr('0',1,5,' '));call close(file);end
  43. if ~exists(path'/data') then do;total = 0;suser = 'TRINITY BBS';line1 = 'Trinity BBS Wall Has Been Reset';line2 = '';line3 = '';call savewall;end
  44. call open(file,path'/data','R')
  45. begin:
  46. seek(file,(w*288),'B')
  47. do while ~eof(file)
  48. w = w + 1
  49. ndte = readch(file,8)
  50. nuser = readch(file,20)
  51. ruser = readch(file,20)
  52. nline1 = readch(file,80)
  53. nline2 = readch(file,80)
  54. nline3 = readch(file,80)
  55. if nuser = ' ' then leave
  56. if new = 0 then transmit ''
  57. transmit 'c1'substr('',1,80,'«')
  58. if level < sysop then ruser = substr('',1,20,' ')
  59.      else ruser = '* 'trim(ruser)' *'
  60. ruser = substr(ruser,1,20,' ')
  61. otr = 'Entry #'w' By : c6'nuser
  62. otr = substr(otr,1,40,' ')
  63. transmit '  c3'otr' 'ruser ' c3Date : c6'ndte
  64. transmit 'n1c7'center(trim(nline1),79)
  65. transmit center(trim(nline2),79)
  66. transmit center(trim(nline3),79)
  67. transmit 'c4'substr('',1,80,'«')
  68. new = 1
  69. m = m + 1
  70. if m // 3 = 0 then 
  71.      do 
  72.      sendstring 'n1c3'w' of 'te' c1Qc4)uit, c1Cc4)ontinue, c1Jc4)ump? c1'
  73.      getchar
  74.      an = result
  75.      if an = '###PANIC' then exit
  76.      if upper(an) = 'Q' then 
  77.           do
  78.           transmit 'Quit!'
  79.           call savestats
  80.           signal editwall
  81.           end     
  82.      if upper(an) = 'J' then
  83.           do
  84.           transmit 'Jumpn1'
  85.           call close(file)
  86.           jump:
  87.           query 'c3Enter New Entry Number : c7'
  88.           w = result
  89.           if w = '###PANIC' then exit
  90.           if ~datatype(w,'N') then w = te + 2
  91.           w = w - 1
  92.           if w > te then do;transmit 'c1From 1 to 'te' Please!n1';signal jump;end
  93.           call open(file,path'/data','R')
  94.           seek(file,(w*288),'B')
  95.           signal begin
  96.           end
  97.           transmit "Let's Read More Of 'Em!"
  98.      end
  99. end
  100. if new = 0 then transmit 'n1c7There Is No New Grafiti.' 
  101. else transmit 'n1c7End Of Entries.'
  102. call savestats
  103. w = w - 1
  104. chjk:
  105. sendstring 'n1c3'w' of 'te' c1Qc4)uit or c1Jc4)ump? c1'
  106. getchar
  107. an = result
  108. if an = '###PANIC' then exit
  109. if an = 'J' then
  110.    do
  111.      transmit 'Jumpn1'
  112.      call close(file)
  113.      jump1:
  114.      query 'c3Enter New Entry Number : c7'
  115.      w = result
  116.      if w = '###PANIC' then exit
  117.      if ~datatype(w,'N') then w = te + 2
  118.      w = w - 1
  119.      if w > te then do;transmit 'c1From 1 to 'te' Please!n1';signal jump1;end
  120.      call open(file,path'/data','R')
  121.      seek(file,(w*288),'B')
  122.      signal begin
  123.    end
  124.    if an ~= 'Q' then signal chjk
  125.    transmit 'Quit!n1'
  126.    signal editwall
  127. exit
  128.  
  129. savestats:
  130. call close(file)
  131. call open(file,path'/users','A')
  132. seek(file,p,'B')
  133. writech(file,substr(user,1,30,' '))
  134. writech(file,substr(w-1,1,5,' '))
  135. call close(file)
  136. return
  137.  
  138. savewall:
  139. if ~exists(path'/data') then do;call open(file,path'/data','W');call close(file);end
  140. call open(file,path'/data','A')
  141. writech(file,dte)
  142. writech(file,substr(suser,1,20,' '))
  143. writech(file,substr(user,1,20,' '))
  144. writech(file,substr(line1,1,80,' '))
  145. writech(file,substr(line2,1,80,' '))
  146. writech(file,substr(line3,1,80,' '))
  147. call close(file)
  148. call open(file,path'/count','W')
  149. te = te + 1
  150. writeln(file,te)
  151. call close(file)
  152. return
  153.  
  154. editwall:     
  155. sendstring 'n1c2Would You Like To Write To The Wall (Y/n)? c1'
  156. getchar
  157. an = result
  158. if an = '###PANIC' then exit
  159. if upper(an) = 'N' then do;transmit 'Nope!';return;end
  160. transmit 'Yes!'
  161. sendstring 'n1c2Will You Be Signing Anonymously? (y/N)? c1'
  162. getchar
  163. an = result
  164. if an = '###PANIC' then exit
  165. if upper(an) = 'Y' then do;transmit 'Yes!';suser = 'ANONYMOUS';end
  166.      else do;transmit 'Nope!';suser = user;end
  167. transmit 'n1c2Enter A Three Line Piece Of Grafiti!n1' 
  168. line1 = '';line2 = '';line3 = ''
  169. query 'c21> c7'
  170. line1 = result
  171. if line1 = '' then signal editwall
  172. query 'c22> c7'
  173. line2 = result
  174. if line2 = '' then signal editwalla
  175. query 'c23> c7'
  176. line3 = result
  177. signal editwalla
  178.  
  179. editwalla:
  180. transmit 'n1c2You Entered : n1c7'
  181. transmit center(trim(line1),79)
  182. transmit center(trim(line2),79)
  183. transmit center(trim(line3),79)
  184. sendstring 'n1c2Does This Look Ok? (Y/n)? c1'
  185. getchar
  186. an = result
  187. if an = "###PANIC" then exit
  188. if upper(an) = 'N' then do;transmit 'Nope!';signal editwall;end
  189. transmit 'Yes! n2c2Adding Your Grafiti To The Wall...'
  190. call savewall
  191. exit